﻿using System.Web.UI;

public partial class Shared_UserControl_GridCommandEx : AdminBaseUserControl
{
    protected override void OnLoad(System.EventArgs e)
    {
        if (string.IsNullOrEmpty(cAdd.OnClientClicking))
            cAdd.CommandName = "InitInsert";
        //权限相关
        if (!CurrentUserGroup.HasAdd)
            ShowAdd = false;
        if (!CurrentUserGroup.HasDel)
            cDels.Visible = false;

        base.OnLoad(e);
    }

    public bool ShowAdd
    {
        set
        {
            cAdd.Visible = value;
        }
    }

    public bool ShowEdit
    {
        set
        {
            cEdit.Visible = value;
        }
    }

    /// <summary>
    /// 添加按钮客户端点击事件
    /// </summary>
    public string OnAddClicking
    {
        set
        {
            cAdd.OnClientClicking = value;
        }
    }

    protected string onEditClicking;

    /// <summary>
    /// 编辑按钮客户端点击事件
    /// </summary>
    public string OnEditClicking
    {
        set
        {
            onEditClicking = value;
        }
    }
}